/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


import java.util.ArrayList;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author TrongKhoa
 */
public class QueryResultTableModel extends AbstractTableModel
{
    ArrayList<String> _header;
    ArrayList<ArrayList<Object>> _data;

    public QueryResultTableModel(ArrayList<ArrayList<Object>> _data, ArrayList<String> _header)
    {
        this._header = _header;
        this._data = _data;
    }
    
    @Override
    public int getRowCount()
    {
        return _data.size();
    }

    @Override
    public int getColumnCount()
    {
        return _header.size();
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex)
    {
        return _data.get(rowIndex).get(columnIndex);
    }

    @Override
    public String getColumnName(int column)
    {
        return _header.get(column);
    }
    
    
}
